﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WebPubManager.aspx.cs" ValidateRequest="false"
    Inherits="WebPubManager" %>

<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Register Src="UserControls/GeneralSelect.ascx" TagName="GeneralSelect" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>添加web页面的后台</title>
    <link href="css/page.css" rel="Stylesheet" type="text/css" />
</head>
<script type="text/javascript">
    function closeWin() {
        if (window.opener != null) {
            window.opener.location.href = window.opener.location.href;
        }
        window.close();
    }

    function NotNull() {
        var objTitle = document.getElementById("<%=txt_title.ClientID %>");
        var objConent = document.getElementById("<%=FreeTextBox1.ClientID %>");

        if (objTitle != null) {
            if (fntrimspace(objTitle.value) == "") {
                alert("请输入【标题】");
                return false;
            }
        }
        else if (fntrimspace(objConent.value) == "") {
            alert("请输入【内容】");
            return false;
        }
        else {
            return true;
        }
    }

    function fntrimspace(str)//去除首尾空格函数
    {
        while (str.substring(0, 1) == " ") {
            str = str.substring(1);
        }
        while (str.substring(str.length - 1) == " ") {
            str = str.substring(0, str.length - 1);
        }
        return str;
    }
</script>
<body>
    <form id="Form1" method="post" runat="server">
    <div style="text-align: center; width: 100%;">
        <table cellspacing="0" border="1" style="border-color: #704300" cellpadding="0" width="100%">
            <tr id="trTjlx" runat="server">
                <td style="color: Red; font-weight: bold; height: 25px; width: 100px;">
                    添加类型：
                </td>
                <td style="color: Red; font-weight: bold; text-align: left;">
                    <asp:Label ID="labMsg" runat="server" Text=""></asp:Label>
                </td>
                <td style="text-align: left; font-weight: bold">
                    登录后自动弹出<asp:CheckBox ID="ckbNotice" runat="server" />
                </td>
            </tr>
            <tr id="trZt" runat="server" visible="true">
                <td>
                    主题：
                </td>
                <td style="text-align: left;" colspan="2">
                    <asp:TextBox ID="txt_title" runat="server" Width="700px"></asp:TextBox>
                </td>
            </tr>
            <tr id="trYwlx" runat="server" visible="false">
                <td>
                    业务类型：
                </td>
                <td style="text-align: left;" colspan="2">
                    <uc2:GeneralSelect ID="ddlYwlx" Name="所有流程" IsParamsData="false" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    内容：
                </td>
                <td style="text-align: left;" colspan="2">
                    <br />
                    <ftb:FreeTextBox ID="FreeTextBox1" runat="server" Width="700" StartMode="DesignMode"
                        AutoConfigure="EnableAll" ButtonPath="images/ftb/office2003/" Height="320px" ImageGalleryPath="image/UploadFile">
                    </ftb:FreeTextBox>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="3">
                    <asp:Button ID="btnSubmit" runat="server" Text="提交" CssClass="input"
                        OnClientClick="return NotNull();" OnClick="btnSubmit_Click"></asp:Button>
                    <input type="button" id="btnClose" value="关闭" class="NewButton" style="width: 0px; display: none;"
                        onclick="closeWin();" />
                    <asp:Button ID="btnReturn" CssClass="NewButton" runat="server" Text="返回" OnClick="btnReturn_Click"
                        Visible="false" CausesValidation="False" />
                </td>
            </tr>
        </table>
    </div>
    <br />
    <div style="text-align: center; color: Red; font-weight: bold; height: 25px;">
        <asp:Label runat="server" ID="labError"></asp:Label>
    </div>
    </form>
</body>
</html>
